<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>泛兰士</title>
    <link href="/home/css/topnav.css" rel="stylesheet" type="text/css"/>
    <link href="/home/css/top.css" rel="stylesheet" type="text/css"/><!--头部通用-->
    <link href="/home/css/foot.css" rel="stylesheet" type="text/css"/><!--尾部通用-->
    <link href="/home/css/style.css" rel="stylesheet" type="text/css"/><!--内容主要样式-->
    <link rel="stylesheet" href="/home/css/reveal.css" type="text/css">    <!--登录modal样式-->
    <link rel="stylesheet" href="/home/css/tips.css" type="text/css">    <!--其他样式-->
    @yield('css')
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?ebce332998cfae7db251848de41481ac";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <script src="/home/js/jquery-1.8.3.min.js"></script>
    <script src="/home/js/jquery.reveal.js"></script>
    <script src="/home/js/layer.js"></script>
    @yield('js')
    <script src="/home/js/jquery.form.js"></script>
</head>
<body>
<div class="topheader">
    <div class="main">
        <div class="top_left"><img src="/home/images/toppic_03.png"/>
            <p>客服热线：027-68781200</p></div>

        @if(!empty($user))
            <div class="top_right">
                <a href="#">您好，{{substr_replace($user->mobile,'****',3,4)}}</a>丨<a href="{{url('user/center')}}" class="big-link">个人中心</a> | <a href="javascript:quit();">退出</a></div>
        @else
            <div class="top_right"><a href="{{url('user/register')}}">注册</a>丨<a href="#" class="big-link" data-reveal-id="myModal" data-animation="none">登录</a></div>
        @endif

    </div>
</div><!--top-->

@yield('content')

<div class="footer">
    <div class="main">
        <div class="footer_box">
            <ul style="width:700px;margin:auto;overflow:hidden;">
                <li style="margin-left:30px;">
                    <h1>关于我们</h1>
                    <a href="http://www.51finace.com/main/newmanual">新手指南</a>
                    <a href="http://www.51finace.com/main/serviceterms">服务条款</a>
                </li>
                <li>
                    <img src="/home/images/erweima_03.png"/>
                    <p style="color:#ffffff;font-size:14px;text-align:center;margin-top:5px;">关注微信公众号</p>
                </li>
                <li id="kefu">
                    <p>客服热线</p>
                    <h1>027-68781200</h1>
                    <a> 7天*24小时</a>
                </li>
            </ul>
        </div>
        <div class="footer_p">
            <p style="text-align:center;">Copyright 2017 武汉泛兰士信息科技有限公司　All Rights Reserved<br/>
                鄂ICP备17022557号</p>
        </div>
    </div>
</div><!--footer-->


<div id="myModal" class="reveal-modal">
    <a class="close-reveal-modal">&#215;</a>
    <div class="modaltop"><h1>欢迎登录</h1></div>
    <form action="{{url('user/login')}}" method="post" name="loginForm" id="loginForm">
        {!! csrf_field() !!}
        <div class="modalbox">
            <span><img src="/home/images/dliconpic_03.png"></span>
            <input class="inputall" type="text" name="mobile" onblur="if (this.value == '') {this.value = '您的手机号';}" onfocus="if (this.value == '您的手机号') {this.value = '';}" value="您的手机号">
        </div>
        <div class="modalbox">
            <span><img src="/home/images/dliconpic_06.png"></span>
            <input class="inputall" type="password" name="password" placeholder="密码" onblur="if (this.value == '') {this.value = '';}" onfocus="if (this.value == '') {this.value = '';}" value="">
        </div>
        <button class="modalbtn loginsubForm">确认</button>
        <div class="modalzi">
            <p>还没有帐号？<a href="{{url('user/register')}}">免费注册</a></p>
            <a href="{{url('user/findpassword')}}">忘记密码？</a>
        </div>
    </form>
</div>

</body>

<script>
    function quit(){
        $.post("{{url('user/quit')}}",function(result){
            if(result.code=='0000'){
                window.location.href="http://m.51finace.com";
            }else{
                layer.alert(result.message);
            }
        })
    }
</script>

<script>
    $(document).ready(function () {
        var loginoptions = {
            success: function (data) {
                console.log(data);
                layer.msg(data.message);
                $(".loginsubForm").attr('disabled',false);
                if(data.code=='0000'){
                    setTimeout(function(){
                        window.location.href="http://m.51finace.com"
                    },1000);
                }
            }
        };
        $(".loginsubForm").click(function () {
            var fm=document.forms['loginForm'];// HTML DOM 通过form 元素的name值获取
            var myreg = /^(((13[0-9]{1})|(17[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
            if (!myreg.test(fm.mobile.value)) {
                layer.msg('请输入有效的手机号码！');
                return false;
            }
            if(fm.password.value==''){
                layer.msg('请填写密码');
                return false;
            }
            $(".loginsubForm").attr('disabled',true);//禁用按钮
            $("#loginForm").ajaxSubmit(loginoptions);
        });
    });
</script>



</html>
